#include <bits/stdc++.h>

#define N 205

using namespace std;

int x[N], y[N], p[N];
vector<int> G[N];
int vis[N] = {0};

double dist(int x1, int y1, int x2, int y2){
    return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}

void dfs(int x){
    vis[x] = 1;
    for(int u : G[x]){
        if(!vis[u]){
            dfs(u);
        }
    }
}

int main(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++){
        scanf("%d %d %d", &x[i], &y[i], &p[i]);
    }
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            if((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]) <= p[i] * p[i]){ // i可以发j
                G[i].push_back(j);
            }
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; i++){
        int cnt = 0;
        fill(vis, vis + n + 1, 0);
        dfs(i);
        for(int j = 1; j <= n; j++){
            if(vis[j])  cnt++;
        }
        ans = max(ans, cnt);
    }
    cout << ans;
    return 0;
}